<template>
	<view>
		<view class=".app" v-for="(item,index) in zixunlist" :key="item.id">
			<view class="zuo">
				<image :src="img_url" mode=""></image>
			</view>
			<view class="you" @click="details(item.id)">
				<view class="title"><text>{{item.title}}</text></view>
				<view class="add">
					<text>发表时间:&nbsp;&nbsp;{{item.add_time|formatDate}}&nbsp;&nbsp;浏览:&nbsp;&nbsp;{{item.click}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				zixunlist:[],
			}
		},
		onLoad() {
			this.zixun()
		},
		methods: {
			// 获取咨询详情
			async zixun(){
				const {status,message} = await uni.$Http.get(`getnewslist`)
				this.zixunlist = message
				console.log(message)
			},
			// 跳转咨询详情
			async details(id) {
				uni.navigateTo({
					url: "../zixunxiangqing/zixunxiangqing?id=" + id
				})
			}
		}
	}
</script>

<style scoped>
	.app{
		display: flex;
		border-bottom: 2px solid red;
	}
	.zuo{
		width: 120px;
		height: 100px;
		/* border: 1px solid red; */
		background-color: #007AFF;
	}
	.you{
		width: 100%;
		height: 100px;
		/* border:  1px solid red; */
	}
	.title{
		font-size: 15px;
	}
	.add{
		font-size: 12px;
		margin-top: 40px;
	}
	image{
		width: 100%;
		height: 100%;
	}
</style>
